package com.sj.tensquare.web.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpSession;

/**
 * @author sj
 * @date 2020/12/14 - 17:28
 */
@Controller
@Slf4j
public class ArticleController {
    @GetMapping("/contact")
    public String contact(Model model, HttpSession session){
        Object username = session.getAttribute("username");
        if (username==null){
            //没有登陆，跳转到登陆服务器进行登陆
            return "redirect:http://localhost:8888/login.html?redirect_url=http://localhost:8888/contact.html";
        }
        return null;
    }
}
